package samoloty.data;

import java.util.ArrayList;
import samoloty.model.IDataModel;
import samoloty.model.models.AcRegModel;
import samoloty.model.models.ConfigurationModel;
import samoloty.model.models.ConstModel;
import samoloty.model.models.CrewModel;
import samoloty.model.models.FuelModel;
import samoloty.model.models.HoldsModel;
import samoloty.model.models.IdealTrimModel;
import samoloty.model.models.LimitLawModel;
import samoloty.model.models.LimitTowModel;
import samoloty.model.models.LimitTowffModel;
import samoloty.model.models.LimitZfwModel;
import samoloty.model.models.LimitZfwffModel;
import samoloty.model.models.MaxWeightsModel;
import samoloty.model.models.PantryModel;
import samoloty.model.models.PaxModel;
import samoloty.model.models.StabTrimModel;
import samoloty.model.models.StabTrimSubModel;
import samoloty.model.models.StabTrimSubSubModel;

public class DataBase1 extends CommonDataBase implements IDataModel {

    public DataBase1() {
        super();
        initData();
    }

    public ArrayList<String> getAcReg() {
        return acRegData;
    }

    public ArrayList<ConfigurationModel> getConfiguration() {
        return configuration;
    }

    public ConstModel getConst() {
        return constData;
    }

    public ArrayList<CrewModel> getCrew() {
        return crewData;
    }

    public ArrayList<FuelModel> getFuel() {
        return fuelData;
    }

    public ArrayList<HoldsModel> getHolds() {
        return holdsData;
    }

    public ArrayList<LimitLawModel> getLimitLaw() {
        return limitLawData;
    }

    public ArrayList<LimitTowModel> getLimitTow() {
        return limitTowData;
    }

    public ArrayList<LimitTowffModel> getLimitTowff() {
        return limitTowffData;
    }

    public ArrayList<LimitZfwModel> getLimitZfw() {
        return limitZfwData;
    }

    public ArrayList<LimitZfwffModel> getLimitZfwff() {
        return limitZfwffData;
    }

    public MaxWeightsModel getMaxWeights() {
        return maxWeightsData;
    }

    public PantryModel getPantry() {
        return pantryData;
    }

    public ArrayList<PaxModel> getPax() {
        return paxData;
    }

    public StabTrimModel getStabTrimFlap1() {
        return stabTrimFlap1Data;
    }

    public StabTrimModel getStabTrimFlap2() {
        return stabTrimFlap2Data;
    }

    public StabTrimModel getStabTrimFlap3() {
        return stabTrimFlap3Data;
    }

    public StabTrimModel getStabTrimFlap4() {
        return stabTrimFlap4Data;
    }

    public ArrayList<IdealTrimModel> getIdealTrim() {
        return idealTrimData;
    }

    private void initData() {
        initAcReg();
        initConst();
        initCrew();
        initConfiguratin();
        initFuel();
        initHolds();
        initLimitLaw();
        initLimitTow();
        initLimitZfw();
        initPantry();
        initPax();
        initMaxWeights();
        initStabTrimFlap1();
        initIdealTrim();
    }

    private void initAcReg() {
        acRegData = new ArrayList<String>();
        acRegData.add(new String("SP-EDE"));
        acRegData.add(new String("SP-EDF"));

    }

    private void initConst() {
        constData = new ConstModel(100, 100, 11.996, 11.425, 2.285);
    }

    private void initCrew() {
        crewData = new ArrayList<CrewModel>();
        crewData.add(new CrewModel("2/0", 2, 0, 170, -12.675));
        crewData.add(new CrewModel("2/1", 2, 1, 245, -8.288));
        crewData.add(new CrewModel("2/2", 2, 2, 320, -11.473));
        crewData.add(new CrewModel("3/0", 3, 0, 255, -18.197));
        crewData.add(new CrewModel("3/1", 3, 1, 330, -13.810));
        crewData.add(new CrewModel("3/2", 3, 2, 405, -16.995));

    }

    private void initConfiguratin() {
        configuration = new ArrayList<ConfigurationModel>();
        configuration.add(new ConfigurationModel("Y46", 0, 46, 0, 14, 0, 20, 0, 12));
        configuration.add(new ConfigurationModel("C8Y38", 8, 38, 0, 14, 0, 20, 8, 4));
        configuration.add(new ConfigurationModel("C12Y34", 12, 34, 0, 14, 0, 20, 12, 0));
        configuration.add(new ConfigurationModel("C16Y30", 16, 30, 0, 14, 4, 16, 12, 0));
        configuration.add(new ConfigurationModel("C20Y26", 20, 26, 0, 14, 8, 12, 12, 0));
        configuration.add(new ConfigurationModel("C24Y22", 24, 22, 0, 14, 12, 8, 12, 0));
        configuration.add(new ConfigurationModel("C28Y18", 28, 18, 0, 14, 16, 4, 12, 0));
        configuration.add(new ConfigurationModel("C32Y14", 32, 14, 0, 14, 20, 0, 12, 0));
        configuration.add(new ConfigurationModel("C36Y10", 36, 10, 4, 10, 20, 0, 12, 0));
        configuration.add(new ConfigurationModel("C40Y6", 40, 6, 8, 6, 20, 0, 12, 0));
        configuration.add(new ConfigurationModel("C46", 46, 0, 14, 0, 20, 0, 12, 0));
        configuration.add(new ConfigurationModel("Y45", 0, 45, 0, 13, 0, 20, 0, 12));
        configuration.add(new ConfigurationModel("C8Y37", 8, 37, 0, 13, 0, 20, 8, 4));
        configuration.add(new ConfigurationModel("C12Y33", 12, 33, 0, 13, 0, 20, 12, 0));
        configuration.add(new ConfigurationModel("C16Y29", 16, 29, 0, 13, 4, 16, 12, 0));
        configuration.add(new ConfigurationModel("C20Y25", 20, 25, 0, 13, 8, 12, 12, 0));
        configuration.add(new ConfigurationModel("C24Y21", 24, 21, 0, 13, 12, 8, 12, 0));
        configuration.add(new ConfigurationModel("C28Y17", 28, 17, 0, 13, 16, 4, 12, 0));
        configuration.add(new ConfigurationModel("C32Y13", 32, 13, 0, 13, 20, 0, 12, 0));
        configuration.add(new ConfigurationModel("C36Y9", 36, 9, 4, 9, 20, 0, 12, 0));
        configuration.add(new ConfigurationModel("C40Y5", 40, 5, 8, 5, 20, 0, 12, 0));
        configuration.add(new ConfigurationModel("C45", 45, 0, 13, 0, 20, 0, 12, 0));

    }

    private void initFuel() {
        fuelData = new ArrayList<FuelModel>();
        fuelData.add(new FuelModel(0, 0.0));
        fuelData.add(new FuelModel(500, 1.3));
        fuelData.add(new FuelModel(1000, 2.5));
        fuelData.add(new FuelModel(1500, 3.8));
        fuelData.add(new FuelModel(2000, 5.1));
        fuelData.add(new FuelModel(2500, 6.3));
        fuelData.add(new FuelModel(3000, 7.6));
        fuelData.add(new FuelModel(3500, 8.9));
        fuelData.add(new FuelModel(4000, 10.1));
        fuelData.add(new FuelModel(4500, 11.4));

    }

    private void initHolds() {
        holdsData = new ArrayList<HoldsModel>();
        holdsData.add(new HoldsModel("5L", 448, -0.05299));
        holdsData.add(new HoldsModel("5R", 288, -0.05757));
        holdsData.add(new HoldsModel("6", 466, 0.07818));

    }

    private void initLimitZfw() {
        limitZfwData = new ArrayList<LimitZfwModel>();
        limitZfwData.add(new LimitZfwModel(11000, 79.9, 11000, 108.1));
        limitZfwData.add(new LimitZfwModel(11500, 81.6, 16700, 122.1));
        limitZfwData.add(new LimitZfwModel(15800, 69.4, 16700, 122.1));
        limitZfwData.add(new LimitZfwModel(16700, 76.2, 16700, 122.1));

    }

    private void initLimitTow() {
        limitTowData = new ArrayList<LimitTowModel>();
        limitTowData.add(new LimitTowModel(11000, 79.9, 11000, 108.1));
        limitTowData.add(new LimitTowModel(11500, 81.6, 16700, 122.1));
        limitTowData.add(new LimitTowModel(15800, 69.4, 18300, 126.1));
        limitTowData.add(new LimitTowModel(16700, 76.2, 18600, 126.8));
        limitTowData.add(new LimitTowModel(18300, 88.4, 18600, 126.8));
        limitTowData.add(new LimitTowModel(18600, 90.7, 18600, 126.8));

    }

    private void initLimitLaw() {
        limitLawData = new ArrayList<LimitLawModel>();
        limitLawData.add(new LimitLawModel(11000, 79.9, 11000, 108.1));
        limitLawData.add(new LimitLawModel(11500, 81.6, 16700, 122.1));
        limitLawData.add(new LimitLawModel(15800, 69.4, 18300, 126.1));
        limitLawData.add(new LimitLawModel(16700, 76.2, 18300, 126.1));
        limitLawData.add(new LimitLawModel(18300, 88.4, 18300, 126.1));

    }

    private void initPantry() {
        pantryData = new PantryModel(0, 0.00000, 0.00000, 0.00000, 599, 0.05629);

    }

    private void initPax() {
        paxData = new ArrayList<PaxModel>();
        paxData.add(new PaxModel("0A", -0.02982));
        paxData.add(new PaxModel("0B", 0.00356));
        paxData.add(new PaxModel("0C", 0.03404));

    }

    private void initMaxWeights() {
        maxWeightsData = new MaxWeightsModel(18770, 18600, 16700, 18300);
    }

    private void initStabTrimFlap1() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(15, 4.5));
        stabMacs1.add(new StabTrimSubSubModel(34, -1.5));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(15, 4.5));
        stabMacs2.add(new StabTrimSubSubModel(34, -1.5));
        stabTrimSub.add(new StabTrimSubModel("", 11000, stabMacs1));
        stabTrimSub.add(new StabTrimSubModel("", 18600, stabMacs2));
        stabTrimFlap1Data = new StabTrimModel(stabTrimSub);

        
    }

    private void initIdealTrim() {
        idealTrimData = new ArrayList<IdealTrimModel>();
        idealTrimData.add(new IdealTrimModel(10000, 100));
        idealTrimData.add(new IdealTrimModel(16700, 100));

    }

    public String getLabel() {
        return "ATR42-500 (46 SEATS)";
    }

    private ArrayList<String> acRegData;
    private ConstModel constData;
    private ArrayList<CrewModel> crewData;
    private ArrayList<ConfigurationModel> configuration;
    private ArrayList<FuelModel> fuelData;
    private ArrayList<HoldsModel> holdsData;
    private ArrayList<LimitZfwModel> limitZfwData;
    private ArrayList<LimitTowModel> limitTowData;
    private ArrayList<LimitLawModel> limitLawData;
    private ArrayList<LimitZfwffModel> limitZfwffData;
    private ArrayList<LimitTowffModel> limitTowffData;
    private PantryModel pantryData;
    private ArrayList<PaxModel> paxData;
    private MaxWeightsModel maxWeightsData;
    private StabTrimModel stabTrimFlap1Data;
    private StabTrimModel stabTrimFlap2Data;
    private StabTrimModel stabTrimFlap3Data;
    private StabTrimModel stabTrimFlap4Data;
    private ArrayList<IdealTrimModel> idealTrimData;
}
